package com.juc.executors.executors4;

import java.util.concurrent.ThreadFactory;

public class MyThreadFactory  implements ThreadFactory{

	/**
     * 无界线程池中的Thread类 可以由程序员自己定制
     * newCachedThreadPool(ThreadFactory threadFactory) 
     */
	@Override
	public Thread newThread(Runnable r) {
        Thread thread = new Thread(r);
        thread.setName(" 定制池中的线程对象的名称 " + Math.random());
		return thread;
	}
     
}
